<%-- 
    Document   : modPermissionBody
    Created on : May 2, 2011, 12:13:05 PM
    Author     : root
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib  prefix="ds" uri="/WEB-INF/tlds/displaycategories.tld" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<script type="text/javascript">
            function hideEdit(id){
                document.getElementById(id).style.display=
                    document.getElementById(id).style.display='block';
                checking('editpost');
                checking('deletepost');
                checking('editthread');
                checking('deletethread');
                checking('edituser');
                checking('banuser');
                checking('suspenduser');
                checking('supper');
            }


            function checking(param){
               // alert("hiiiiiiii");
              // alert(count);
               var radios = document.getElementsByTagName('param');
              //  alert(document.getElementById(param).innerHTML + "rrrrrr");
                switch(param){
                    case 'editpost':
                       // alert(document.getElementById(param).innerHTML +"editpost");
                        if(document.getElementById(param).innerHTML=="true"){

                    document.edit.editpost[0].checked=true;
                //alert("inside the true ");
                }else{
                    document.edit.editpost[1].checked=true;
                    //alert("inside false");valueOf
                }
                        break;
                    case 'deletepost':valueOf
                        //alert("**"+document.getElementById(param).innerHTML+"deletepost");
                        if(document.getElementById(param).innerHTML=="true"){
                valueOf
                    document.edit.deletepost[0].checked=true;
                //alert("inside the true ");
                }else{
                    document.edit.deletepost[1].checked=true;
                    //alert("inside false");
                }
                        break;
                        case 'editthread':
                       //     alert(document.getElementById(param).innerHTML+"editthread");
                        if(document.getElementById(param).innerHTML=="true"){

                    document.edit.editthread[0].checked=true;
                //alert("inside the true ");
                }else{
                    document.edit.editthread[1].checked=true;
                    //alert("inside false");
                }
                break;
                    case 'deletethread':
                     //   alert(document.getElementById(param).innerHTML + "deletethread");
                        if(document.getElementById(param).innerHTML=="true"){

                    document.edit.deletethread[0].checked=true;
                //alert("inside the true ");
                }else{
                    document.edit.deletethread[1].checked=true;
                    //alert("inside false");
                }
                        break;
                    case 'edituser':
                   //     alert(document.getElementById(param).innerHTML + "edituser");
                        if(document.getElementById(param).innerHTML=="true"){

                    document.edit.edituser[0].checked=true;
                //alert("inside the true ");
                }else{
                    document.edit.edituser[1].checked=true;
                    //alert("inside false");
                }
                        break;
                    case 'banuser':
                 //       alert(document.getElementById(param).innerHTML + "banuser");
                        if(document.getElementById(param).innerHTML=="true"){

                    document.edit.banuser[0].checked=true;
                //alert("inside the true ");
                }else{
                    document.edit.banuser[1].checked=true;
                    //alert("inside false");
                }
                        break;
                    case 'suspenduser':
               //         alert(document.getElementById(param).innerHTML + "suspenduser");
                        if(document.getElementById(param).innerHTML=="true"){

                    document.edit.suspenduser[0].checked=true;
                //alert("inside the true ");
                }else{
                    document.edit.suspenduser[1].checked=true;
                    //alert("inside false");
                }
                        break;
                    case 'supper':
                       // alert(document.getElementById(param).innerHTML + "supper");
                        if(document.getElementById(param).innerHTML=="true"){

                    document.edit.supper[0].checked=true;
                //alert("inside the true ");
                }else{
                    document.edit.supper[1].checked=true;
                    //alert("inside false");
                }
                        break;

                }

            }
        </script>
<div id="page-body">
    <table border="1" cellpadding="5" width="1100">
        <tr>
            <td><h3>
                    Moderator ID</h3>
            </td>
            <td><h3>
                Edit Post</h3>
            </td>
            <td><h3>
                Delete Post</h3>
            </td>
            <td><h3>
                Edit Thread</h3>
            </td>
            <td><h3>
                Delete Thread</h3>
            </td>
            <td><h3>
                Edit User</h3>
            </td>
            <td><h3>
                Ban User</h3>
            </td>
            <td><h3>
                Suspend User</h3>
            </td>
            <td><h3>
                Super Moderator</h3>
            </td>
            <td><h3>
                Edit Permission </h3>
            </td>
        </tr>
        <tr>
            <td>
                <div id="modId"><bean:write name="fMO" property="modId"/></div>
            </td>
            <td>
                <div id="editpost"><bean:write name="fMO" property="editpost"/></div>
            </td>
            <td>
                <div id="deletepost"><bean:write name="fMO" property="deletepost"/></div>
            </td>
            <td>
                <div id="editthread"><bean:write name="fMO" property="editthread"/></div>
            </td>
            <td>
                <div id="deletethread"><bean:write name="fMO" property="deletethread"/></div>
            </td>
            <td>
                <div id="edituser"><bean:write name="fMO" property="edituser"/></div>
            </td>
            <td>
                <div id="banuser" ><bean:write name="fMO" property="banuser"/></div>
            </td>
            <td>
                <div id="suspenduser"><bean:write name="fMO" property="suspenduser"/></div>
            </td>
            <td>
                <div id="supper"><bean:write name="fMO" property="supper"/></div>
            </td>
            <td align="center"><h3>
                    <button title="Edit" onclick="hideEdit('hidden')">Edit</button> </h3>
            </td>
        </tr>
    </table>
            
            <div id="hidden"style="display: none" >
                <form name="edit" id="edit" action="editModPermAc.do">
                    Moderator Id<input name="modId" id="modId"readonly="readonly" value="<bean:write name="fMO" property="modId"/>"/>
                    <table>
                       
                        <tr>
                            <td> Edit Post</td><td><input type="radio" name="editpost" value="true" />true
                <input type="radio" name="editpost" value="false"/>false<br/></td></tr>
 
                <tr><td>Delete Post</td><td> <input type="radio" name="deletepost" value="true"/>true
                <input type="radio" name="deletepost" value="false"/>false<br/></td> </tr>
                
                <tr><td>Edit Thread</td><td> <input type="radio" name="editthread" value="true"/>true
                <input type="radio" name="editthread" value="false"/>false<br/></td></tr>
                
                <tr><td>Delete Thread </td><td><input type="radio" name="deletethread" value="true" />true
                <input type="radio" name="deletethread" value="false"/>false<br/></td></tr>
                
                <tr><td>Edit User </td><td><input type="radio" name="edituser" value="true"/>true
                <input type="radio" name="edituser" value="false"/>false<br/></td></tr>
                
                <tr><td>Ban User</td><td> <input type="radio" name="banuser" value="true"/>true
                <input type="radio" name="banuser" value="false"/>false<br/></td></tr>
                
                <tr><td>Suspend User</td><td><input type="radio" name="suspenduser" value="true" />true
                <input type="radio" name="suspenduser" value="false"/>false<br/></td></tr>
                
                <tr><td>Super User</td><td> <input type="radio" name="supper" value="true" />true
                <input type="radio" name="supper" value="false"/>false<br/></td></tr>
                
                    </table>
                <input type="submit" value="Save"/>
                     
                </form>
            </div>
</div>
